<?
require('./application/views/header.php');

?>


		
    	<div id="content">
   			
            
        
			<?
			
			if($this -> exists('nieuws')){
			
			$bericht = $this -> nieuws ?>
            
            <h2><?= $bericht -> title; ?></h2>
            
            <div class="bericht">
            	<?= $bericht -> nieuws_text ?>
            </div>
          <div class="info_row"><p><?= $bericht -> geb_naam?> | <?= $bericht -> datum?></p>
       
        	
         
          
          </div>    
             <a href="/nieuws/" class="terug">Terug naar het archief</a>  
    	<? }elseif($this -> exists('nieuwsberichten')){?>
        
        <h2>Nieuwsarchief</h2>
        
           <? if($this -> exists('prevPage') || $this -> exists('nextPage')){ ?>   
				 <ul class="page_menu">
            <? if($this -> exists('prevPage')){ ?>
            <li><a href="/nieuws/<?=$this -> prevPage?>/" class="backBtn">Vorige</a></li>
            <? }
				if($this -> exists('nextPage')){
			 ?>
            <li><a href="/nieuws/<?=$this -> nextPage?>/" class="forBtn">Volgende</a></li>
            <?
			}
			?>
            </ul>
				
				
				<? } ?>
        
		<table cellpadding="0" cellspacing="0">
        <tr><th>Titel:</th><th>Datum:</th></tr>
        
        
				<? foreach($this -> nieuwsberichten as $bericht){
				
					echo '<tr><td><a href="/nieuws/'.view::encodeForUrl($bericht -> title).'/'.$bericht -> id.'"/">' . $bericht -> title . '</a></td>';
					echo '<td>' . $bericht -> datum . '</td></tr>';
				
				}
		
		 ?>
            
         </table>
         
           <? if($this -> exists('prevPage') || $this -> exists('nextPage')){ ?>   
				 <ul class="page_menu">
            <? if($this -> exists('prevPage')){ ?>
            <li><a href="/nieuws/<?=$this -> prevPage?>/" class="backBtn">Vorige</a></li>
            <? }
				if($this -> exists('nextPage')){
			 ?>
            <li><a href="/nieuws/<?=$this -> nextPage?>/" class="forBtn">Volgende</a></li>
            <?
			}
			?>
            </ul>
				
				
				<? } ?>
         <? }?>
        </div>
   
<? include('footer.php'); ?>